package com.feihua.starter.service.impl;

import com.feihua.starter.service.api.ApiHdbUserExtendPoService;
import com.feihua.starter.service.mapper.HdbUserExtendPoMapper;
import com.feihua.starter.service.modules.hdb.dto.HdbUserExtendDto;
import com.feihua.starter.service.modules.hdb.dto.SearchHdbUserExtendsConditionDto;
import com.feihua.starter.service.modules.hdb.po.HdbUserExtendPo;
import com.github.pagehelper.Page;
import feihua.jdbc.api.pojo.PageAndOrderbyParamDto;
import feihua.jdbc.api.pojo.PageResultDto;
import feihua.jdbc.api.service.impl.ApiBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * This class was generated by MyBatis Generator.
 * @author revolver 2018-06-29 22:26:30
 */
@Service
public class ApiHdbUserExtendPoServiceImpl extends ApiBaseServiceImpl<HdbUserExtendPo, HdbUserExtendDto, String> implements ApiHdbUserExtendPoService {
    @Autowired
    HdbUserExtendPoMapper hdbUserExtendPoMapper;

    public ApiHdbUserExtendPoServiceImpl() {
        super(HdbUserExtendDto.class);
    }

    @Override
    public PageResultDto<HdbUserExtendDto> searchHdbUserExtendsDsf(SearchHdbUserExtendsConditionDto dto,PageAndOrderbyParamDto pageAndOrderbyParamDto) {
        Page p = super.pageAndOrderbyStart(pageAndOrderbyParamDto);
        List<HdbUserExtendDto> list = this.wrapDtos(hdbUserExtendPoMapper.searchHdbUserExtends(dto));
        return new PageResultDto(list, this.wrapPage(p));
    }

    @Override
    public HdbUserExtendDto selectByUserId(String userId) {
        return hdbUserExtendPoMapper.selectByUserId(userId);
    }
}